package com.project.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.project.daos.AdminOrderMapper;
import com.project.entity.Order1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminOrderService {
    @Autowired
    private AdminOrderMapper adminOrderMapper;

    public PageInfo<Order1> selAllOrder(String keyWord,Integer currentPage,Integer pageSize){
        PageHelper.startPage(currentPage,pageSize);
        List<Order1> order1s = adminOrderMapper.selAllOrder(keyWord);
        PageInfo<Order1> order1PageInfo = new PageInfo<>(order1s);
        return order1PageInfo;
    }

    public Integer delOrder(Object[] ids){
        Integer integer = adminOrderMapper.delOrder(ids);
        return integer;
    }
}
